from  scapy.all import  *
import time
from config import *

peer = 'a'
con_iface = 'eth0'
port = 12769

sock = conf.L2socket(iface=con_iface)
co = 0
portRange = range(1,65536)

for i in portRange:    
    co += 1
    if co == 1000:
        co = 0
        print(i)
    if peer == 'a':        
        p = Ether()/IP(src=bPublicIp,dst=aPublicIp)/UDP(dport=i,sport=port)/Raw(load=str(i))
    else:
        p = Ether()/IP(src=aPublicIp,dst=bPublicIp)/UDP(dport=i,sport=port)/Raw(load=str(i))
    
    sock.send(p)  
    sock.send(p)  
    sock.send(p)  

